home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / System Software / QuickTime 1.5 / Interfaces / ImageCodec.p < prev    next >
Encoding:
Text File  |  1992-10-20  |  5.8 KB  |  204 lines  |  [TEXT/MPS ]

  1. {
  2.  
  3. Created: Friday, September 27, 1991 10:04:39 AM
  4.  ImageCodec.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.  
  8.  Copyright Apple Computer, Inc. 1991
  9.  All rights reserved
  10.  
  11. }
  12.  
  13. {$IFC UNDEFINED UsingIncludes}
  14. {$SETC UsingIncludes := 0}
  15. {$ENDC}
  16.  
  17. {$IFC NOT UsingIncludes}
  18.  UNIT ImageCodec;
  19.  INTERFACE
  20. {$ENDC}
  21.  
  22. {$IFC UNDEFINED UsingImageCodec}
  23. {$SETC UsingImageCodec := 1}
  24.  
  25. {$I+}
  26. {$SETC ImageCodecIncludes := UsingIncludes}
  27. {$SETC UsingIncludes := 1}
  28. {$IFC UNDEFINED UsingQuickDraw}
  29. {$I $$Shell(PInterfaces)QuickDraw.p}
  30. {$ENDC}
  31. {$IFC UNDEFINED UsingQDOffscreen}
  32. {$I $$Shell(PInterfaces)QDOffscreen.p}
  33. {$ENDC}
  34.  
  35. {$IFC UNDEFINED UsingTypes}
  36. {$I $$Shell(PInterfaces)Types.p}
  37. {$ENDC}
  38.  
  39. {$IFC UNDEFINED UsingComponents}
  40. {$I $$Shell(PInterfaces)Components.p}
  41. {$ENDC}
  42.  
  43. {$IFC UNDEFINED UsingImageCompression}
  44. {$I $$Shell(PInterfaces)ImageCompression.p}
  45. {$ENDC}
  46.  
  47.  
  48. {$SETC UsingIncludes := ImageCodecIncludes}
  49.  
  50.  
  51. {    codec component selectors    }
  52. {    codec selectors 0-127 are reserved by Apple }
  53. {    codec selectors 128-191 are subtype specific }
  54. {    codec selectors 192-255 are vendor specific }
  55. {     codec selectors 256-32767 are reserved by Apple }
  56. {    negative selectors are reserved by the Component Manager }
  57.  
  58. CONST
  59. codecGetCodecInfo                    = $00;
  60. codecGetCompressionTime                = $01;
  61. codecGetMaxCompressionSize            = $02;
  62. codecPreCompress                    = $03;
  63. codecBandCompress                    = $04;
  64. codecPreDecompress                    = $05;
  65. codecBandDecompress                    = $06;
  66. codecCDSequenceBusy                    = $07;
  67. codecGetCompressedImageSize            = $08;
  68. codecGetSimilarity                    = $09;
  69. codecTrimImage                        = $0a;
  70.  
  71.  
  72. {    codec capabilities flags    }
  73.  
  74. codecCanScale                        = $1;
  75. codecCanMask                        = $2;
  76. codecCanMatte                        = $4;
  77. codecCanTransform                    = $8;
  78. codecCanTransferMode                = $10;
  79. codecCanCopyPrev                    = $20;
  80. codecCanSpool                        = $40;
  81. codecCanClipVertical                = $80;
  82. codecCanClipRectangular                = $100;
  83. codecCanRemapColor                    = $200;
  84. codecCanFastDither                    = $400;
  85. codecCanSrcExtract                    = $800;
  86. codecCanCopyPrevComp                = $1000;
  87. codecCanAsync                        = $2000;
  88. codecCanMakeMask                    = $4000;
  89. codecCanShift                        = $8000;
  90.  
  91.  
  92.  
  93. codecConditionFirstBand                = $1;    
  94. codecConditionLastBand                = $2;
  95. codecConditionCodecChangedMask        = $80000000;
  96.  
  97.  
  98.  
  99. codecInfoResourceType    =    'cdci';                    { codec info resource type }
  100.  
  101. TYPE
  102. CodecCapabilities = RECORD
  103.     flags:    LONGINT;
  104.     wantedPixelSize: INTEGER;
  105.     extendWidth: INTEGER;
  106.     extendHeight: INTEGER;
  107.     bandMin: INTEGER;
  108.     bandInc: INTEGER;
  109.     pad: INTEGER;
  110.     time: INTEGER;
  111. END;
  112. CodecCapabilitiesPtr =  ^CodecCapabilities;
  113.  
  114.  
  115. TYPE
  116. CodecCompressParams = RECORD
  117.     sequenceID :ImageSequence ;                        { precompress,bandcompress }
  118.     imageDescription: ImageDescriptionHandle;        { precompress,bandcompress }
  119.     data : Ptr;
  120.     bufferSize : LONGINT;
  121.     frameNumber: LONGINT;
  122.     startLine: LONGINT;
  123.     stopLine: LONGINT;
  124.     conditionFlags: LONGINT;
  125.     callerFlags : CodecFlags;
  126.     capabilities : CodecCapabilitiesPtr;            { precompress,bandcompress }
  127.     progressProcRecord : ProgressProcRecord;
  128.     completionProcRecord : CompletionProcRecord;    
  129.     flushProcRecord : FlushProcRecord;
  130.     srcPixMap  :PixMap;                                { precompress,bandcompress }
  131.     prevPixMap : PixMap;
  132.     spatialQuality : CodecQ;
  133.     temporalQuality : CodecQ;
  134.     similarity : fixed;
  135.     reserved: ARRAY [0..1] OF LONGINT;        
  136. END;
  137. CodecCompressParamsPtr = ^CodecCompressParams;
  138.  
  139.  
  140. TYPE
  141. CodecDecompressParams = RECORD
  142.     sequenceID : ImageSequence;                        { predecompress,banddecompress }
  143.     imageDescription : ImageDescriptionHandle;        { predecompress,banddecompress }
  144.     data : Ptr;
  145.     bufferSize : LONGINT;
  146.     frameNumber : LONGINT;
  147.     startLine : LONGINT;
  148.     stopLine : LONGINT;
  149.     conditionFlags : LONGINT;
  150.     callerFlags : CodecFlags;
  151.     capabilities : CodecCapabilitiesPtr;            { predecompress,banddecompress }
  152.     progressProcRecord : ProgressProcRecord;
  153.     completionProcRecord : CompletionProcRecord;
  154.     dataProcRecord : DataProcRecord;
  155.     port : CGrafPtr;                                { predecompress,banddecompress }
  156.     dstPixMap : PixMap;                                { predecompress,banddecompress }
  157.     maskBits : BitMapPtr;
  158.     mattePixMap : PixMapPtr;
  159.     srcRect : Rect;                                    { predecompress,banddecompress }
  160.     matrix : MatrixRecordPtr;                        { predecompress,banddecompress }
  161.     accuracy : CodecQ;                                { predecompress,banddecompress }
  162.     transferMode : INTEGER;                            { predecompress,banddecompress }
  163.     reserved : ARRAY [0..1] OF LONGINT;                
  164. END;
  165. CodecDecompressParamsPtr = ^CodecDecompressParams;
  166.  
  167.  
  168. FUNCTION CDGetCodecInfo(storage : Handle;VAR info: CodecInfo) : ComponentResult;
  169.  
  170. FUNCTION CDGetCompressionTime(storage : Handle; src: PixMapHandle; srcRect : Rect;  depth  :INTEGER ;
  171.      VAR spatialQuality: CodecQ; VAR temporalQuality: CodecQ;VAR time: LONGINT): ComponentResult;
  172.  
  173. FUNCTION CDGetMaxCompressionSize(storage : Handle; src : PixMapHandle; srcRect : Rect; 
  174.     depth : INTEGER; quality : CodecQ;VAR size : LONGINT) : ComponentResult;
  175.  
  176. FUNCTION CDPreCompress(storage : Handle;params : CodecCompressParamsPtr) : ComponentResult;
  177.  
  178. FUNCTION CDBandCompress(storage : Handle;params: CodecCompressParamsPtr) : ComponentResult;
  179.  
  180. FUNCTION CDPreDecompress(storage : Handle;params: CodecDecompressParamsPtr) : ComponentResult;
  181.  
  182. FUNCTION CDBandDecompress(storage : Handle;params: CodecDecompressParamsPtr) : ComponentResult;
  183.  
  184. FUNCTION CDCodecBusy(storage : Handle;seq : ImageSequence) : ComponentResult;
  185.  
  186. FUNCTION CDGetCompressedImageSize(storage : Handle; desc : ImageDescriptionHandle;data : PTR;
  187.     bufferSize :LONGINT;  dataProc : DataProcRecordPtr;VAR dataSize: LONGINT) : ComponentResult;
  188.  
  189. FUNCTION CDGetSimilarity(storage : Handle; src : PixMapHandle; srcRect : Rect;
  190.      desc : ImageDescriptionHandle; data : Ptr; VAR similarity : Fixed) : ComponentResult;
  191.  
  192. FUNCTION CDTrimImage(storage : Handle; desc : ImageDescriptionHandle; inData: Ptr; inBufferSize : LONGINT; 
  193.      dataProc : DataProcRecordPtr; outData : Ptr; outBufferSize : LONGINT; 
  194.      flushProc : FlushProcRecordPtr; VAR trimRect : Rect; progressProc : ProgressProcRecordPtr) : ComponentResult;
  195.  
  196.  
  197.  
  198. {$ENDC} { UsingImageCodec }
  199.  
  200. {$IFC NOT UsingIncludes}
  201.  END.
  202. {$ENDC}
  203.  
  204.